from django.conf.urls import url
from django.contrib import admin
from web.views import server, project, task

urlpatterns = [
    url(r'^admin/', admin.site.urls),

    # 服务器管理
    url(r'^server/list/$', server.server_list, name='server_list'),
    url(r'^server/add/$', server.server_add, name='server_add'),
    url(r'^server/edit/(?P<pk>\d+)/$', server.server_edit, name='server_edit'),
    url(r'^server/delete/(?P<pk>\d+)/$', server.server_delete, name='server_delete'),

    # 项目管理
    url(r'^project/list/$', project.project_list, name='project_list'),
    url(r'^project/add/$', project.project_add, name='project_add'),
    url(r'^project/edit/(?P<pk>\d+)/$', project.project_edit, name='project_edit'),
    url(r'^project/delete/(?P<pk>\d+)/$', project.project_delete, name='project_delete'),

    # 任务发布
    url(r'^task/list/(?P<project_id>\d+)/$', task.task_list, name='task_list'),
    url(r'^task/add/(?P<project_id>\d+)/$', task.task_add, name='task_add'),
    url(r'^hook/template/(?P<hook_id>\d+)/$', task.hook_template, name='hook_template'),
    url(r'^deploy/(?P<task_id>\d+)/$', task.deploy, name='deploy'),
]
